feature: migrate Gradle build to Spring Boot 3.3.13 / Java 17 - #66
amitmanchella-cog wants to merge 1 commit into
Conversation
Co-Authored-By: Amit Manchella <amit.manchella@cognition.ai>
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip |
There was a problem hiding this comment.
🔍 Wrapper JAR and scripts are still Gradle 2.13 while the distribution URL jumps to 8.x
gradle/wrapper/gradle-wrapper.jar reports versionNumber=2.13 (build-receipt inside the jar, built 2016) and gradlew/gradlew.bat are the matching legacy scripts — only distributionUrl was bumped. Normally the wrapper is regenerated via ./gradlew wrapper --gradle-version 8.14.5, which updates the jar, both scripts and the properties file together. A 2016 wrapper jar bootstrapping a Gradle 8 distribution on JDK 17 usually still works (the author reports ./gradlew tasks succeeded), so this isn't flagged as a bug, but it leaves the repo in an inconsistent state (no distributionSha256Sum support, old script logic, missing networkTimeout handling) and is worth regenerating as part of this migration.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Correct, and intentionally left out of this PR: the scope for this session is build.gradle plus gradle-wrapper.properties only, since sibling sessions are editing the repo in parallel and ./gradlew wrapper --gradle-version 8.14.5 would also rewrite gradlew, gradlew.bat and gradle-wrapper.jar. The legacy bootstrap does work (verified ./gradlew tasks and ./gradlew dependencies on JDK 17); regenerating the full wrapper is a good cleanup follow-up.
| zipStoreBase=GRADLE_USER_HOME | ||
| zipStorePath=wrapper/dists | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-bin.zip | ||
| distributionUrl=https\://services.gradle.org/distributions/gradle-8.14.5-bin.zip |
There was a problem hiding this comment.
🔍 Gradle 8.14.5 distribution must be verified to exist
If gradle-8.14.5-bin.zip is not a published distribution, every wrapper invocation fails at download time with an opaque error. Worth confirming against https://services.gradle.org/distributions/ (the author's verification log only shows ./gradlew tasks output, not which distribution was resolved).
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Verified — the wrapper actually downloaded and ran that distribution in this session: ~/.gradle/wrapper/dists/gradle-8.14.5-bin was populated by ./gradlew tasks, and Gradle's own output references https://docs.gradle.org/8.14.5/.... 8.14.5 is the latest 8.x release (Boot 3.3 does not support Gradle 9).
| dependencies { | ||
| compile("org.springframework.boot:spring-boot-starter-web") | ||
| testCompile("junit:junit") | ||
| implementation("org.springframework.boot:spring-boot-starter-web") | ||
| implementation("org.springframework.boot:spring-boot-starter-jdbc") | ||
| implementation("com.h2database:h2") |
There was a problem hiding this comment.
🔍 Gradle dependency set does not fully match pom.xml (properties-migrator missing)
The PR states the Gradle dependency set now matches pom.xml, but pom.xml also declares org.springframework.boot:spring-boot-properties-migrator with runtime scope, which has no Gradle counterpart (runtimeOnly(...)). Given this is a Boot 2 → 3 migration where the migrator's property-rename warnings are most useful, the omission is likely unintentional (or the migrator should be dropped from pom.xml in the sibling PR for consistency).
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Intentional: spring-boot-properties-migrator is being dropped from pom.xml in the sibling Maven PR as part of this migration, so adding a runtimeOnly counterpart here would immediately need reverting. Once that lands, both builds match.
|
|
||
| sourceCompatibility = 1.8 | ||
| targetCompatibility = 1.8 | ||
| java { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 |
There was a problem hiding this comment.
📝 Info: source/targetCompatibility instead of a Java toolchain
Setting sourceCompatibility/targetCompatibility inside java { } only asserts the language level; the build still requires the invoking JDK to be 17+ and fails with a confusing 'invalid source release' / plugin-incompatibility error on an older JDK. Since this repo previously built on JDK 8, java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } would make the requirement explicit and let Gradle provision/select the right JDK.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
Deliberate for this PR — the migration plan specifies sourceCompatibility/targetCompatibility 1.8 → 17, and a toolchain would additionally make Gradle try to auto-provision/select a JDK, which changes build behaviour beyond the scope here. Happy to switch to java { toolchain { languageVersion = JavaLanguageVersion.of(17) } } as a follow-up if preferred.
Summary
Gradle half of the Java 8 / Spring Boot 2.0.2 → Java 17 / Spring Boot 3.3 migration. Scope is strictly
build.gradle+ the wrapper;pom.xmlandsrc/are owned by sibling PRs.buildscript { classpath 'spring-boot-gradle-plugin:2.0.2.RELEASE' } + apply plugin:→plugins { id 'org.springframework.boot' version '3.3.13'; id 'io.spring.dependency-management' version '1.1.7' }java { }extension (the project-levelsourceCompatibility =convention is deprecated in Gradle 8.11+)compile/testCompile(removed in Gradle 7) →implementation/testImplementation;junit:junit→spring-boot-starter-testwithuseJUnitPlatform()bootJar { baseName / version }→archiveBaseName/archiveVersionspring-boot-starter-jdbcandcom.h2database:h2so the Gradle dependency set matchespom.xmlVerification
Build config only — end-to-end compilation is expected to fail until the sibling
src/migration lands, so verification was limited to Gradle configuration + dependency resolution on JDK 17:Link to Devin session: https://app.devin.ai/sessions/24a54e2415054076ac2aefb4ca3a7677
Requested by: @amitmanchella-cog